import java.util.Vector;

public class Demo20 {
    public static void main(String[] args) {
        Vector<String> v = new Vector<>();

        Thread t1 = new Thread(() -> {
            if(v.isEmpty()) {
                v.add("hello");
            }
        });

        Thread t2 = new Thread(() -> {
            if(v.isEmpty()) {
                v.add("hello");
            }
        });
    }
}
